package com.xxg.renrenorder.component;

import com.xxg.renrencommon.domain.filedenum.orderenum.OptTypeEnum;
import com.xxg.renrenorder.dao.OrderMasterInfoDao;
import com.xxg.renrenorder.dao.bean.OperationInfo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 类说明
 *
 * @author szj
 * @date 2021/12/15
 */
@Service
@Slf4j
@AllArgsConstructor
public class OrderComponentImpl implements OrderComponent{
    private final OrderMasterInfoDao orderMasterInfoDao;

    @Override
    public void recordOpt(String orderId, Integer userId, OptTypeEnum optType) {
        OperationInfo operationInfo = new OperationInfo();
        operationInfo.setUserId(userId);
        operationInfo.setOptType(optType.getValue());
        operationInfo.setContent(optType.getName());
        orderMasterInfoDao.pushOperationInfo(orderId, operationInfo);
    }
}
